<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        const str = 'b aaa aaaa aaaaaa aa a';

        // console.log(str.match(/a{3}/g));
        // console.log(str.match(/a{4}/g));
        // console.log(str.match(/a{1,5}/g));
        // console.log(str.match(/a{1,}/g));//+
        console.log(str.match(/a+/g));// /a{1,}/g
        console.log(str.match(/a?/g));// /a{0,1}/g
        console.log(str.match(/a*/g));// /a{0,}/g






    </script>
</body>

</html>